package com.alibaba.aone.casestudy.dao.impl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.alibaba.aone.casestudy.common.entity.FailureRpAsignGroup;
import com.alibaba.aone.casestudy.dao.FailureRpAsignGroupDao;

/**
 * 类IbatisFailureRpAsignGroupDao.java的实现描述：TODO 类实现描述
 * 
 * @author yongchun.chengyc 2011-4-26 下午09:01:17
 */
public class IbatisFailureRpAsignGroupDao extends SqlMapClientDaoSupport
		implements FailureRpAsignGroupDao {

	/*public FailureRpAsignGroup load(String failureNumber) {

		return (FailureRpAsignGroup) getSqlMapClientTemplate().queryForObject(
				"FAILURERPASIGNGROUP.getGroupByFailureNumber", failureNumber);
	}*/
	
	

	public void insertGroup(FailureRpAsignGroup group) {
		getSqlMapClientTemplate().insert("FAILURERPASIGNGROUP.addGroup", group);
	}

	public void update(FailureRpAsignGroup group) {
		getSqlMapClientTemplate().update("FAILURERPASIGNGROUP.updateGroup",
				group);

	}

	public List<FailureRpAsignGroup> findAll() {
		return this.getSqlMapClientTemplate().queryForList(
				"FAILURERPASIGNGROUP.selectAll");
	}

	public void delete(String number) {
		getSqlMapClientTemplate().delete("FAILURERPASIGNGROUP.deleteGroup");
		
	}

	public List<FailureRpAsignGroup> findGroup(String failureNumber) {
		
		return getSqlMapClientTemplate().queryForList(
				"FAILURERPASIGNGROUP.getGroupByFailureNumber", failureNumber);
	}
}
